package com.sky.controller.user;

import com.sky.pojo.Category;
import com.sky.result.Result;
import com.sky.service.user.UserCategoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//查询分类
@RestController
@RequestMapping("/user/category")
public class UserCategoryController {

@Autowired
private UserCategoryService userCategoryService;



   /**
    * 查询菜品分类回显到用户端
   查询分类左侧边菜单栏*/
    @GetMapping("/list")
    @ApiOperation("用户端查询菜品分类")
    public Result<List<Category>> userSelectCategory(){

        List<Category> categories = userCategoryService.selectUsercategoryListService();

        return Result.success(categories);
    }




}
